﻿using System;
using UnityEngine;

namespace RootMotion
{
	// Token: 0x020001DD RID: 477
	public abstract class Singleton<T> : MonoBehaviour where T : Singleton<T>
	{
		// Token: 0x170000C8 RID: 200
		// (get) Token: 0x060009FA RID: 2554 RVA: 0x000364B9 File Offset: 0x000348B9
		public static T instance
		{
			get
			{
				return Singleton<T>.sInstance;
			}
		}

		// Token: 0x060009FB RID: 2555 RVA: 0x000364C0 File Offset: 0x000348C0
		protected virtual void Awake()
		{
			if (Singleton<T>.sInstance != null)
			{
				Debug.LogError(base.name + "error: already initialized", this);
			}
			Singleton<T>.sInstance = (T)((object)this);
		}

		// Token: 0x04000699 RID: 1689
		private static T sInstance;
	}
}
